//  转换时间段方法
export const format = (value) => {
  let interval = Math.floor(value);
  let minute = Math.floor(interval / 60)
    .toString()
    .padStart(2, "0");
  let second = (interval % 60).toString().padStart(2, "0");
  return `${minute}:${second}`;
}

export let debounce = (fn, delay = 200) => {
  let timer = null;
  return function () {
    if (timer) clearTimeout(timer);
    timer = setTimeout(() => {
      fn.apply(this, arguments);
      timer = null;
    }, delay);
  }
}